
for i in range(10):
    print(i, end=" ")
print()
for i in range(5,10):
    print(i, end=' ')
